package com.google.antranking.utils;

import java.util.ArrayList;

public class StringArrayList extends ArrayList<String>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 8876494914786082093L;

	public StringArrayList parse(String strlist){
		this.removeAll(this);
		for (String str : strlist.split(";")){
			if (!str.equals(""))
				this.add(str);
		}
		return this;
	}
	
	public String toString(){
		final StringBuffer buf = new StringBuffer();
		for (String str : this){
			if (!buf.toString().equals(""))
				buf.append(";");
			buf.append(str);
		}
		return buf.toString();
	}
	
	public String[] createArray(){
		return this.toArray(new String[this.size()]);
	}
	
	
}
